﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net;
using System.IO;
using System.Text;

namespace MvcCreditoHipotecario.Models
{
    public class InfocorpModel
    {
        public static string ObtenerPersonasDeuda(string nroDocumento)
        {
            string mensaje;
            var url = "http://localhost:4625/Infocorp.svc/Infocorp/" + nroDocumento;
            var request = (HttpWebRequest)WebRequest.Create(url);
            var response = (HttpWebResponse)request.GetResponse();
            response.StatusCode.ToString();

            using (Stream respStream = response.GetResponseStream())
            {
                StreamReader reader = new StreamReader(respStream, Encoding.UTF8);
                mensaje = reader.ReadToEnd();
            }

            return mensaje;
        }
    }
}